package com.powernode.teatraceability.dao.plateprocessmgt;

import com.powernode.teatraceability.pojo.plateprocessmgt.ProductBatch;
import com.powernode.teatraceability.pojo.sourceinfo.BhInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
@Mapper
public interface ProductBatchMapper {

    List<ProductBatch> selectLike(@Param("qydm") String qydm,@Param("cpmc") String cpmc);

    BhInfo selectBhInfo(String pch);

    String selectCpbhByPch(String pch);

    String selectCdbhByPch(String pch);

    String selectCpmcByPch(String pch);

    List<ProductBatch> selectAllInfo(String qydm);

    List<String> selectAllPch();
    @Select("select distinct(cpmc) from t_cppc where qydm = #{qydm}")
    List<String> selectAllCpmc(String qydm);

    @Select("select distinct(pch) from t_cppc where cpmc = #{cpmc} and qydm = #{qydm}")
    List<String> selectAllPchByCpmc(@Param("cpmc") String Cpmc, @Param("qydm") String qydm);

    int delete(int bh);

    int insert(ProductBatch productBatch);

    @Select("select count(*) from t_cppc where qydm = #{qydm}")
    Integer countInfo(String qydm);
}
